package com.home.cop.employee.mapper;

import com.home.cop.employee.model.Employee;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface EmployeeMapper {
    int deleteByPrimaryKey(String empAcct);

    int insert(Employee record);

    int insertSelective(Employee record);

    Employee selectByPrimaryKey(String empAcct);

    int updateByPrimaryKeySelective(Employee record);

    int updateByPrimaryKey(Employee record);


    /**
     * 根据电话号码获取员工
     * @param phone
     * @return
     */
    public List<Employee> getEmployeeByPhone(@Param("phone") String phone);

    /**
     * 根据用户账号密码登录
     * @param account
     * @param pwd
     * @return
     */
    public Employee getEmployee(@Param("account") String account,@Param("pwd") String pwd);

    /**
     * 启用禁用员工
     * @param account
     * @param status
     */
    public void updateStatus(@Param("account") String account,@Param("status") Integer status);

    /**
     * 修改员工密码
     * @param account
     * @param pass
     */
    public void updatePass(@Param("account") String account,@Param("pass") String pass);

    /**
     * 根据角色编号获取员工数量
     * @param roleId
     * @return
     */
    public Integer countEmployeeByRole(@Param("roleId") String roleId);

    /**
     * 按照条件筛选员工列表
     * @param params
     * @return
     */
    public List<Employee> list(Map<String,Object> params);

    /**
     * 获取机构下的员工列表
     * @param instId
     * @return
     */
    public List<Employee> getEmployeeByInstId(Integer instId);
}